import tensorflow as tf

if __name__ == '__main__':
    input_shape = (2, 4, 5, 3)
    x = tf.random.uniform(input_shape)
    print(x.numpy())
    # 池化层降维，输入形状 (2, 4, 5, 3) 转换为(2, 1, 1, 3)，然后删减维度为(2, 3)
    y = tf.keras.layers.GlobalAveragePooling2D()(x)
    print(y.numpy())


